backend/docker-compose: remove race condition and improve interactive dev experience - #627
Merged
Merged
Conversation
t-lo
force-pushed
the
t-lo/improve-backend-docker-compose
branch
from
November 24, 2022 16:02
45f496d to
2bc1261
Compare
illume
reviewed
Nov 24, 2022
illume
left a comment
Contributor
There was a problem hiding this comment.
Cool. Thanks.
I wonder if it makes sense to add a make target for the persistence. For documentation/ease of use.
t-lo
force-pushed
the
t-lo/improve-backend-docker-compose
branch
2 times, most recently
from
November 25, 2022 07:35
78ca8a4 to
784cb39
Compare
This change adds a dependency to the (nebraska) "server" service on the "postgres" service in docker-compose.test.yaml. Motivation of the change is to prevent a race condition where the "server" container starts faster than "postgres", fails to connect to the database, and shuts down. Additionally, an optional persistent storage for postgres is added. DB contents can be persisted across docker-compose runs to aid manual, interactive testing. Usage instructions have been added to the YAML files as comments. The local directory used for persiting postgres data has been added to .gitignore to prevent accidental commits. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
t-lo
force-pushed
the
t-lo/improve-backend-docker-compose
branch
from
November 25, 2022 07:36
784cb39 to
f1f0704
Compare
pothos
reviewed
Nov 25, 2022
…ice restart Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
pothos
approved these changes
Nov 30, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change adds a dependency to the (nebraska) "server" service on the "postgres" service in docker-compose.test.yaml. Motivation of the change is to prevent a race condition where the "server" container starts faster than "postgres", fails to connect to the database, and shuts down.
Additionally, an optional persistent storage for postgres is added. DB contents can be persisted across docker-compose runs to aid manual, interactive testing. Usage instructions have been added to the YAML files as comments. The local directory used for persiting postgres data has been added to .gitignore to prevent accidental commits.
Tested locally with:
docker-compose --file docker-compose.test.yaml build(works as expected)docker-compose --file docker-compose.test.yaml up(works as expected)docker-compose --file docker-compose.test.yaml --file docker-compose.pg-persist.yaml updocker-compose --file docker-compose.test.yaml --file docker-compose.pg-persist.yaml downdocker-compose --file docker-compose.test.yaml --file docker-compose.pg-persist.yaml up